@(project: String)

@widgets.dialog(title = "Import Link Specification", submitLabel = "Import", width = 500) {
<div>
  <input name="file" type="file" id="link_spec_file_import" style="outline:none;"/>
</div>


<script>//<![CDATA[
function submit() {
  var name = $("select[name='name']").val();
  var file = $("input[name='file']").val();
  var formData = new FormData($('form')[0]);

  console.log(formData);

  $.ajax({
    type: 'POST',
    url: '@config.baseUrl/workspace/projects/@project/importLinkSpec',
    xhr: function() {
      myXhr = $.ajaxSettings.xhr();
      return myXhr;
    },
    data: formData,
    cache: false,
    contentType: false,
    processData: false,
    success: function(data) {
      closeDialog();
      reloadWorkspace();
    },
    error: function(request) {
      alert(request.responseText);
    }
  });
}
//]]>
</script>
}